import { TodoReducerType, TodoActionType, addTodo } from '../store/todo'
import { Dispatch } from 'redux'
import { connect } from 'react-redux'
import TodoAdd from '../components/TodoAdd'

const mapStateToProps = (state: TodoReducerType) => ({})

const mapDispatchToProps = (dispatch: Dispatch<TodoActionType>) => ({
  addNewTodo: (name: string) => dispatch(addTodo(name))
})

export default connect(mapStateToProps, mapDispatchToProps)(TodoAdd)
